<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

<head>
	<base href="/">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    

    <title>后台 - 登录</title>
    <meta name="keywords" content="后台 - 登录">
    <meta name="description" content="后台 - 登录">

    <link rel="shortcut icon" href="favicon.ico">
	<link href="static/templet/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">

    <link href="static/templet/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">

    <link href="static/templet/css/animate.min.css" rel="stylesheet">

    <link href="static/templet/css/login.min.css" rel="stylesheet">
    <link href="static/templet/css/base.css" rel="stylesheet">
    <link href="static/templet/css/style.min.css?v=4.0.0" rel="stylesheet">
    <!--[if lt IE 8]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

    
    <body class="signin">
    <div class="signinpanel" style="width:1200px">
            <div class="col-sm-5">
                <div class="signin-info" style="color:rgba(255,255,255,.95);margin-top:100px">
                    <div class="logopanel m-b">
                        <h1>[ ${companyName }Seo优化 ]</h1>
                    </div>
                    <div class="m-b"></div>
                    <h3>欢迎使用 <strong>${companyDesc }Seo优化</strong></h3>
                    <ul class="m-b-lg">
                        <li class="m-b-xs"><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 自身网站排名就能看出SEO的专业程度</li>
                        <li class="m-b-xs"><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 先上首页后扣费安全保障权益</li>
                        <li class="m-b-xs"><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 排名上首页按天扣费超低划算价格</li>
                        <li class="m-b-xs"><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 关键词排名财务报表清晰透明</li>
                        <li class="m-b-xs"><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 规范优化技术确保排名稳定上升</li>
                    </ul>
                </div>
            </div>
            <div class="col-sm-7">
            <div class="middle-box">
                <form method="post" class="m-t" role="form" action="index.html">
                	
                    <h2 class="no-margins text-white"><strong>登录：</strong></h2>
                    <div class="form-group">
                    <input type="text" id="userName" class="h50 lh50 form-control uname" placeholder="用户名" />
                    </div>
                    <div class="form-group">
                    <input type="password" id="password" class="h50 lh50 form-control pword m-b-none" placeholder="密码" />
                    </div>
                    <div class="form-group">
                    
								<div class="row">
									<div class="col-xs-6" >
										<input type="text" class="h50 lh50 form-control" style="margin-top: 0px;color: #000000"
											id="code" placeholder="请输入验证码" />
									</div>
									<div class="col-xs-6">
										<img id="img_verify"  class="h50" style="max-width:100%;"
											src="code/captcha-image" />
									</div>
								</div>
					</div>
                    <p class="text-muted text-center"> <a href="login.html#">忘记密码了？</a> | <a href="register">注册一个新账号</a>
                	</p>
                    <button type="button" id="loginBtn" class="btn btn-success btn-block btn-lg">登录</button>
                    
                </form>
                </div>
            </div>
        </div>
    </div>
</body>
    
    <script src="static/templet/js/jquery.min.js?v=2.1.4"></script>
    <script src="static/templet/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="static/templet/js/plugins/layer/layer.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
		$("#img_verify").on("click", function() {
			$(this).attr("src", "code/captcha-image?t=" + Math.random());
		});
		
		$("#loginBtn").on("click", function() {
			var userName = $("#userName").val();
			var password = $("#password").val();
			var code = $("#code").val();
			$.post('login/toLogin',{userName:userName,password:password,code:code}, function(data, status){
				if(status == 'success'){
					var result = data.result;
					var state = result.state;
					console.log(result)
					if(state == 1){
						layer.msg('登录成功', {icon: 1});
						location.href = 'main';
					}else{
						var code = result.code;
						if(code == 'goLogin'){
							layer.confirm('您的登录网址：<br>'+data.domain+'<br>是否马上登录', {
							    btn: ['登录','取消'],
							    shade: 0.8
							}, function(index){
								layer.close(index);
								location.href = 'http://'+data.domain;
							}, function(){
							    
							});
						}else{
							layer.msg(result.message, {icon: 1});
						}
					}
				}
			})
		});
		
		$(document).keyup(function(event) {
			if (event.keyCode == 13) {
				$("#loginBtn").trigger("click");
			}
		});
    });
    </script>


</html>